package com.ny.gongzi;

import java.util.Scanner;

public class Gongzi {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("===== 工资计算器 =====");
        System.out.println("1. 正式员工工资");
        System.out.println("2. 实习生工资");
        System.out.println("3. 兼职员工工资");
        System.out.println("4. 退出系统");
        System.out.print("请选择操作类型: ");


        int choice;
        while (true) {
            try {
                choice = scanner.nextInt();
                if (choice < 1 || choice > 4) {
                    System.out.print("输入无效，请重新选择: ");
                    continue;
                }
                break;
            } catch (Exception e) {
                System.out.print("请输入数字: ");
                scanner.next();
            }
        }

        if (choice == 4) {
            System.out.println("感谢使用，再见！");
            scanner.close();
            return;
        }

        System.out.println("\n=== 请输入工资信息 ===");
        System.out.print("基本工资: ");
        double xz = scanner.nextDouble();

        System.out.print("工作月份数: ");
        int months = scanner.nextInt();

        double zxz = 0;
        String yuangong = "";

        switch (choice) {
            case 1:
                yuangong = "正式员工";
                zxz = xz * months + xz * 0.3 * months;
                break;
            case 2:
                yuangong = "实习生";
                zxz = xz * months * 0.5; //
                break;
            case 3:
                yuangong = "兼职员工";
                zxz = xz * months + 250 * months;
                break;
        }

        // 显示计算结果
        System.out.println("\n=== 工资计算结果 ===");
        System.out.println("员工类型: " + yuangong);
        System.out.println("工作月份: " + months);
        System.out.println("总工资: " + zxz);

        scanner.close();
    }
}
